#ifndef INITDATA_H
#define INITDATA_H

#include <QObject>
#include <QCoreApplication>
#include <QMutex>
#include <QSettings>
#include <QDebug>
#include <QDateTime>
#include <QTime>
#include <QDate>
class InitData : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString scanner_Port READ scanner_Port WRITE setScanner_Port NOTIFY scanner_PortChanged FINAL)
    Q_PROPERTY(QString scanner_BaudRate READ scanner_BaudRate WRITE setScanner_BaudRate NOTIFY scanner_BaudRateChanged FINAL)
    Q_PROPERTY(QString scanner_DataBit READ scanner_DataBit WRITE setScanner_DataBit NOTIFY scanner_DataBitChanged FINAL)
    Q_PROPERTY(QString scanner_Parity READ scanner_Parity WRITE setScanner_Parity NOTIFY scanner_ParityChanged FINAL)
    Q_PROPERTY(QString scanner_StopBit READ scanner_StopBit WRITE setScanner_StopBit NOTIFY scanner_StopBitChanged FINAL)

    Q_PROPERTY(QString printer_Port READ printer_Port WRITE setprinter_Port NOTIFY printer_PortChanged FINAL)
    Q_PROPERTY(QString printer_BaudRate READ printer_BaudRate WRITE setprinter_BaudRate NOTIFY printer_BaudRateChanged FINAL)
    Q_PROPERTY(QString printer_DataBit READ printer_DataBit WRITE setprinter_DataBit NOTIFY printer_DataBitChanged FINAL)
    Q_PROPERTY(QString printer_Parity READ printer_Parity WRITE setprinter_Parity NOTIFY printer_ParityChanged FINAL)
    Q_PROPERTY(QString printer_StopBit READ printer_StopBit WRITE setprinter_StopBit NOTIFY printer_StopBitChanged FINAL)



public:

    static InitData* getInstance();
    static InitData* m_instance;
    static QMutex m_mutex;


    void init_Data();
    void save_Data();

    QString scanner_Port() const;
    void setScanner_Port(const QString &newScanner_Port);

    QString scanner_BaudRate() const;
    void setScanner_BaudRate(const QString &newScanner_BaudRate);

    QString scanner_DataBit() const;
    void setScanner_DataBit(const QString &newScanner_DataBit);

    QString scanner_Parity() const;
    void setScanner_Parity(const QString &newScanner_Parity);

    QString scanner_StopBit() const;
    void setScanner_StopBit(const QString &newScanner_StopBit);

    QString printer_Port() const;
    void setprinter_Port(const QString &newPrinter_Port);

    QString printer_BaudRate() const;
    void setprinter_BaudRate(const QString &newPrinter_BaudRate);

    QString printer_DataBit() const;
    void setprinter_DataBit(const QString &newPrinter_DataBit);

    QString printer_Parity() const;
    void setprinter_Parity(const QString &newPrinter_Parity);

    QString printer_StopBit() const;
    void setprinter_StopBit(const QString &newPrinter_StopBit);

private:
    InitData(QObject *parent = nullptr);
    ~InitData();
    InitData(const InitData&)=delete;
    InitData& operator=(const InitData)=delete;

    QString m_scanner_Port;

    QString m_scanner_BaudRate;

    QString m_scanner_DataBit;

    QString m_scanner_Parity;

    QString m_scanner_StopBit;

    QString m_printer_Port;

    QString m_printer_BaudRate;

    QString m_printer_DataBit;

    QString m_printer_Parity;

    QString m_printer_StopBit;

signals:
    void scanner_PortChanged();
    void scanner_BaudRateChanged();
    void scanner_DataBitChanged();
    void scanner_ParityChanged();
    void scanner_StopBitChanged();
    void printer_PortChanged();
    void printer_BaudRateChanged();
    void printer_DataBitChanged();
    void printer_ParityChanged();
    void printer_StopBitChanged();
};

#endif // INITDATA_H
